<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="${pageContext.request.contextPath}/themes/bootstrap/easyui.css" />
<link type="text/css"
	href="${pageContext.request.contextPath}/themes/icon.css"
	rel="stylesheet">
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery-1.9.1.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath}/js/easyui-lang-zh_CN.js"></script>
<title>Insert title here</title>
</head>
<script type="text/javascript">
$(function(){
	
	//下拉框中的表格
	$('#cc').combogrid({ 
		width:200,
		height:30,
		editable:false,
	    panelWidth:650,
	    panelHeight:310,
	    value:'',    	    
	    pagination:true,
	    rownumbers:true,
	    pageSize:10,
	    pageList:[10,15,20],
	    idField:'supId',    
	    textField:'supId',    
	    url:'supplier',    
	    columns:[ [ 
	                 
	                {field : 'supId',title : '供应商Id',width : 100,hidden : true,align : 'center'}, 
	                {field : 'supName',title : '供应商厂家名',width : 180,align : 'center'}, 
	                {field : 'supContacts',title : '供应商厂家联系人',width : 100,align : 'center'}, 
	                {field : 'supPhone',title : '厂家联系人电话',width : 100,align : 'center'}, 
	                {field : 'eId',title : '我方负责人',width : 100,align : 'center'},
	                {field : 'eName',title : '负责人姓名',width : 100,align : 'center'},
	                ] ], 
	              
	   //点击行的事件
	    onClickRow:function(index,row){
	    	//获取框中的值
	    	var supId=$('#cc').combo('getValue');
	    	
	    	$('#dg').datagrid({    
	    	    url:'selectProductBySupllier', 
	    	    queryParams:{supId:supId}, 
	    	    pagination:true,
	    	    rownumbers:true,
	    	    closable:true,
	    	    pageSize:5,
	    	    pageList:[5,10,15],
	    	    columns:[[    
	    	        {field:'pId',title:'编号',width:100},    
	    	        {field:'pName',title:'品名',width:100},    
	    	        {field:'pType',title:'型号',width:100,align:'right'},
	    	        {field:'pAmount',title:'数量',width:100}, 
	    	        {field:'pClass',title:'种类',width:100}, 
	    	        {field:'pCost',title:'进货价',width:100}, 
	    	        {field:'pPrice',title:'出售价',width:100}, 
	    	        {field:'pTime',title:'进货时间',width:100}, 
	    	        {field:'supId',title:'供应商',width:100}, 
	    	    ]]    
	    	});
	    	
	    	//通过供应商查询货物的的日志
	    	$.ajax({
	    		url:'selectProductBysupplierDailyLXG',
	    		type:'post',
	    		dataType:'json',
	    		success:function(data){
	    			if(data==1){}else{
	    				$.messager.alert('我的消息','日志生成失败！','info');



	    			}
	    		}
	    		
	    	})
	    	
	    },             
	});  


	
	
	
})

</script>
<body>
	<!-- 下拉框 -->
	<input id="cc" name="dept"/>
	
	<!-- 查询货物的结果表 -->
	<table id="dg"></table> 
	
</body>
</html>